# Upgrade default config from sway for switch to sis (SIS Is Sway)
#
# Copy this to ~/.config/sway/config and edit it to your liking.
# 
# See Default config for sway here: /etc/sway/config
# Copy config for sway to ~/.config/sway/config and edit it to your liking.
# 
# Read `man 5 sway` for a complete reference.

### Variables
# 
# Key bottoms
# 
	# Use Mod1 for Alt or use Mod4 for Super (default).
	set $Super Mod4
	set $Alt Mod1

	# Logo bottom for sway. Use $Super (default) or $Alt.
	set $ModBottom $Super
	# Logo bottom for sis. You can use $ModBottom (for use logo-bottom from sway).
	# set $LogoBottom $ModBottom
	set $LogoBottom $Alt

	# Key for move window
	# set $MoveBottom Ctrl+Alt
	# set $MoveBottom Space
	set $MoveBottom $ModBottom+Shift
	# set $FocusBottom Ctrl+Alt
	set $FocusBottom $ModBottom

	set $AdminBottom Ctrl+$ModBottom
	set $SystemKey Ctrl+Alt
	
	# Home row direction keys, like vim
	# set $VimLeft h
	# set $VimDown j
	# set $VimUp k
	# set $VimRight l

	# Home row direction keys, like in any game
	set $Up w
	set $Left a
	set $Down s
	set $Right d
# 
# Application
# 
	# Default Menu
	# commit if you ever want use Selected Menu:
	set $list_application  dmenu_path | dmenu | xargs swaymsg exec --	

	# Default Terminal
	# commit if you ever want use Selected Terminal:
	set $terminal xterm

### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
#   output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs

### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
#          timeout 300 'swaylock -f -c 000000' \
#          timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
#          before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.

### Input configuration
#
# Example configuration:
#
#   input "2:14:SynPS/2_Synaptics_TouchPad" {
#       dwt enabled
#       tap enabled
#       natural_scroll enabled
#       middle_emulation enabled
#   }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.

### Key bindings
# 
# Basics:
# 
    # Kill focused window
    bindsym Alt+F4 kill
    
    # Drag floating windows by holding down $mod and left mouse button.
    # Resize them with right mouse button + $mod.
    # Despite the name, also works for non-floating windows.
    # Change normal to inverse to use left mouse button for resizing and right
    # mouse button for dragging.
    floating_modifier $ModKey normal

    # Reload the configuration file
    bindsym Alt+F5 reload

    # Exit sway (logs you out of your Wayland session)
    bindsym $ModKey+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'

    # Exit from sway
    bindsym $AdminKey+Backspace exit
 	  
    
### Sway keys:
#
# Linux container
#
	mode "sway" {
		# Kill focused window
	    bindsym Ctrl+q kill
	    bindsym $LogoKey+F4 kill
	    
	    # Reload config for sway
	    bindsym Ctrl+r reload
	    bindsym $LogoKey+F5 reload12
	        
	    # Start your (default - if have) launcher
	    bindsym $LogoKey+Menu exec $menu

	    # Start a (default - if have) terminal
	    bindsym $LogoKey+Tab exec $term
	    
	    # Exit from sway
	    bindsym $LogoKey+Backspace exit
 	    
	    # Restart your Linux
	    bindsym $LogoKey+Insert exec reboot
	    # ShutDown your Linux
	    bindsym $LogoKey+Delete exec poweroff


		# net {lan, wifi, usb} and media {volume, voise, song} and device {camera, microphone}

	    # Go to modes
	    bindsym $LogoKey+a mode "audio"
	    bindsym $LogoKey+n mode "net"
	    bindsym $Move+Return mode "move"
	    bindsym $Focus+Return mode "focus"
	    
	    # Return to default mode
	    bindsym Escape mode "default"
	}
	bindsym $LogoKey+Escape mode "sway"
	mode "move" {
	    # Move the focused window with the same, but add Shift
	    bindsym $LogoKey+$Left move left
	    bindsym $LogoKey+$Down move down
	    bindsym $LogoKey+$Up move up
	    bindsym $LogoKey+$Right move right
	    # Ditto, with arrow keys
	    bindsym Left move left
	    bindsym Down move down
	    bindsym Up move up
	    bindsym Right move right

	    # Move focused container to workspace
	    bindsym 1 move container to workspace number 1
	    bindsym 2 move container to workspace number 2
	    bindsym 3 move container to workspace number 3
	    bindsym 4 move container to workspace number 4
	    bindsym 5 move container to workspace number 5
	    bindsym 6 move container to workspace number 6
	    bindsym 7 move container to workspace number 7
	    bindsym 8 move container to workspace number 8
	    bindsym 9 move container to workspace number 9
	    bindsym 0 move container to workspace number 10
	    # Note: workspaces can have any name you want, not just numbers.
	    # We just use 1-10 as the default.

	    # Go to modes
	    bindsym $LogoKey+Tab mode "audio"
	    bindsym $LogoKey+n mode "net"
	    bindsym $Move+Return mode "move"
	    bindsym $Focus+Return mode "focus"
	    
	    # Return to default mode
	    bindsym Escape mode "default"
	}
	bindsym $Move+Return mode "move"
	mode "focus" {
	    # Move your focus around
	    bindsym $LogoKey+$Left focus left
	    bindsym $LogoKey+$Down focus down
	    bindsym $LogoKey+$Up focus up
	    bindsym $LogoKey+$Right focus right
	    # Or use $mod+[up|down|left|right]
	    bindsym Left focus left
	    bindsym Down focus down
	    bindsym Up focus up
	    bindsym Right focus right

	    # Switch to workspace
	    bindsym 1 workspace number 1
	    bindsym 2 workspace number 2
	    bindsym 3 workspace number 3
	    bindsym 4 workspace number 4
	    bindsym 5 workspace number 5
	    bindsym 6 workspace number 6
	    bindsym 7 workspace number 7
	    bindsym 8 workspace number 8
	    bindsym 9 workspace number 9
	    bindsym 0 workspace number 10

	    # Go to modes
	    bindsym $LogoKey+Tab mode "audio"
	    bindsym $LogoKey+n mode "net"
	    bindsym $Move+Return mode "move"
	    bindsym $Focus+Return mode "focus"

	    # Return to default mode
	    bindsym Escape mode "default"
	}
	bindsym $Focus+Return mode "focus"
# 
# Moving around:
# 
    # Move your focus around
    bindsym $ModKey+$Left focus left
    bindsym $ModKey+$Down focus down
    bindsym $ModKey+$Up focus up
    bindsym $ModKey+$Right focus right
    # Or use $mod+[up|down|left|right]
    bindsym $ModKey+Left focus left
    bindsym $ModKey+Down focus down
    bindsym $ModKey+Up focus up
    bindsym $ModKey+Right focus right

    # Move the focused window with the same, but add Shift
    bindsym $Move+$Left move left
    bindsym $Move+$Down move down
    bindsym $Move+$Up move up
    bindsym $Move+$Right move right
    # Ditto, with arrow keys
    bindsym $Move+Left move left
    bindsym $Move+Down move down
    bindsym $Move+Up move up
    bindsym $Move+Right move right
#
# Workspaces:
#
    # Switch to workspace
    bindsym $ModKey+1 workspace number 1
    bindsym $ModKey+2 workspace number 2
    bindsym $ModKey+3 workspace number 3
    bindsym $ModKey+4 workspace number 4
    bindsym $ModKey+5 workspace number 5
    bindsym $ModKey+6 workspace number 6
    bindsym $ModKey+7 workspace number 7
    bindsym $ModKey+8 workspace number 8
    bindsym $ModKey+9 workspace number 9
    bindsym $ModKey+0 workspace number 10

    # Move focused container to workspace
    bindsym $Move+1 move container to workspace number 1
    bindsym $Move+2 move container to workspace number 2
    bindsym $Move+3 move container to workspace number 3
    bindsym $Move+4 move container to workspace number 4
    bindsym $Move+5 move container to workspace number 5
    bindsym $Move+6 move container to workspace number 6
    bindsym $Move+7 move container to workspace number 7
    bindsym $Move+8 move container to workspace number 8
    bindsym $Move+9 move container to workspace number 9
    bindsym $Move+0 move container to workspace number 10
    # Note: workspaces can have any name you want, not just numbers.
    # We just use 1-10 as the default.

	# for lock for sis
    bindsym $ModKey+l workspace l
#
# Layout stuff:
#
    # You can "split" the current object of your focus with
    # $mod+b or $mod+v, for horizontal and vertical splits
    # respectively.
    bindsym $AdminKey+b splith
    bindsym $AdminKey+v splitv

    # Switch the current container between different layout styles
    bindsym $AdminKey+s layout stacking
    bindsym $AdminKey+w layout tabbed
    bindsym $AdminKey+e layout toggle split

    # Make the current focus fullscreen
    bindsym $AdminKey+f fullscreen

    # Toggle the current focus between tiling and floating mode
    bindsym $ModKey+Shift+space floating toggle

    # Swap focus between the tiling area and the floating area
    bindsym $ModKey+space focus mode_toggle

    # Move focus to the parent container
    bindsym $AdminKey+a focus parent
#
# Scratchpad:
#
    # Sway has a "scratchpad", which is a bag of holding for windows.
    # You can send windows there and get them back later.

    # Move the currently focused window to the scratchpad
    bindsym $ModKey+Shift+minus move scratchpad

    # Show the next scratchpad window or hide the focused scratchpad window.
    # If there are multiple scratchpad windows, this command cycles through them.
    bindsym $ModKey+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
    # left will shrink the containers width
    # right will grow the containers width
    # up will shrink the containers height
    # down will grow the containers height
    bindsym $Left resize shrink width 10px
    bindsym $Down resize grow height 10px
    bindsym $Up resize shrink height 10px
    bindsym $Right resize grow width 10px

    # Ditto, with arrow keys
    bindsym Left resize shrink width 10px
    bindsym Down resize grow height 10px
    bindsym Up resize shrink height 10px
    bindsym Right resize grow width 10px

    # Return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $ModKey+r mode "resize"

#
# WayBar:
#
bar {
	swaybar_command waybar
}

#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
# bar {
    # position top
# 
    # # When the status_command prints a new line to stdout, swaybar updates.
    # # The default just shows the current date and time.
    # status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
# 
    # colors {
        # statusline #ffffff
        # background #323232
        # inactive_workspace #32323200 #32323200 #5c5c5c
    # }
# }


#
# Keyboard
#
	input * {
		xkb_layout us,ru
		xkb_options grp:alt_shift_toggle
	}

include /etc/sway/config.d/*

include ~/.sis/sis.conf

